package com.ccl.iot;import com.ccl.iot.IOTInterface.IOTNameMonitorInterface;
import com.ccl.iot.IOTInterface.IOTNameMonitorInterface.IOTNameChangeListener;

public class IOTNameMonitor extends IOTMonitor<IOTNameChangeListener> implements IOTNameMonitorInterface {
	private IOTNameMonitorInterface iSource = this;

	public IOTNameMonitor(){
		
	}

	public IOTNameMonitor(IOTNameMonitorInterface aSource){
		if (aSource != null){
			iSource = aSource;
		}
	}
	
	@Override
	public boolean addNameChangeListener(IOTNameChangeListener aListener) {
		return super.addMonitorListener(aListener);
	}
	
	@Override
	public boolean removeNameChangeListener(IOTNameChangeListener aListener){
		return super.removeMonitorListener(aListener);
	}

	public void onNameChange(String aName) {
		int tIndex = 0;
		IOTNameChangeListener tListener;
		
		while((tListener = super.getMonitorListener(tIndex++)) != null){
//			tListener.onNameChanged(iSource, aName);
		}
	}
}
